<?php
namespace plugins\pay\lib;

class Common 
{
    
    //获取插件
    private static  function getPlugins()
    {
        $path = PLUGINS_PATH.'pay'.DS.'lib';
        $dir  = scandir( $path );
        $list = [];
        foreach ( $dir as $key => $value ){
            if( $value == '.' || $value == '..' ) continue;
            if( is_dir ( $path . DS . $value ) ) $list [] = $value;
        }
        return $list;
    }
    
    //获取开启的支付
    public static function getPayListWithOn()
    {
        $list = getModuleConfig( 'pay' , 'config', "pay_switch_on.json" );
        $list = json_decode( $list , true );
        return empty( $list ) ? [] : $list;
    }
    
    //保存开启的支付信息
    public static function savePayListWithOn( $data )
    {
        //$data = array_column( $data , 'value');
        return saveModuleConfigData( 'pay', "config", "pay_switch_on.json", $data );
    }
    
    
    
    
    
    
    
    
    
    
}